<script setup lang="ts">
import { computed } from "vue";
const props = defineProps(["tableData"]);
const emit = defineEmits(["selectchanged"]);
const handleSelectionChange = val => {
  emit("selectchanged", val);
};
const tableData = computed(() => props.tableData);
const columns: TableColumnList = [
  {
    type: "selection",
    align: "left"
  },
  {
    label: "编号",
    prop: "id",
    sortable: true
  },
  {
    label: "类型",
    prop: "msgClass"
  },
  {
    label: "用户",
    prop: "addUser"
  },
  {
    label: "时间",
    prop: "addTime",
    sortable: true
  }
];
</script>

<template>
  <div>
    <pure-table
      ref="tableRef"
      :data="tableData"
      :columns="columns"
      @selection-change="handleSelectionChange"
      :header-cell-style="{
        background: 'var(--el-fill-color-light)',
        color: 'var(--el-text-color-primary)'
      }"
    />
  </div>
</template>
